X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialImport.php;h=9e9f8c083e2fc43a45a9b23329f399dc439118a0;hb=958167760104b037db7db0a3c64e248052217759;hp=3d762aa3138620b153f30ebcf9f096322414d042;hpb=8a52d9af46bfee45737c0b8b05e174c843382579;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialImport.php b/includes/specials/SpecialImport.php index 3d762aa313..9e9f8c083e 100644 --- a/includes/specials/SpecialImport.php +++ b/includes/specials/SpecialImport.php @@ -47,17 +47,20 @@ class SpecialImport extends SpecialPage { */ public function __construct() { parent::__construct( 'Import', 'import' ); - $this->namespace = $this->getConfig()->get( 'ImportTargetNamespace' ); } /** * Execute * @param string|null $par + * @throws PermissionsError + * @throws ReadOnlyError */ function execute( $par ) { $this->setHeaders(); $this->outputHeader(); + $this->namespace = $this->getConfig()->get( 'ImportTargetNamespace' ); + $this->getOutput()->addModules( 'mediawiki.special.import' ); $user = $this->getUser(); @@ -157,7 +160,7 @@ class SpecialImport extends SpecialPage { array( 'importfailed', $source->getWikiText() ) ); } else { - $importer = new WikiImporter( $source->value ); + $importer = new WikiImporter( $source->value, $this->getConfig() ); if ( !is_null( $this->namespace ) ) { $importer->setTargetNamespace( $this->namespace ); } @@ -251,7 +254,7 @@ class SpecialImport extends SpecialPage { Xml::label( $this->msg( 'import-comment' )->text(), 'mw-import-comment' ) . " " . - Xml::input( 'log-comment', 50, + Xml::input( 'log-comment', 50, ( $this->sourceName == 'upload' ? $this->logcomment : '' ), array( 'id' => 'mw-import-comment', 'type' => 'text' ) ) . ' ' . " @@ -518,13 +521,14 @@ class ImportReporter extends ContextSource { /** * @param Title $title - * @param Title $origTitle + * @param ForeignTitle $foreignTitle * @param int $revisionCount * @param int $successCount * @param array $pageInfo * @return void */ - function reportPage( $title, $origTitle, $revisionCount, $successCount, $pageInfo ) { + function reportPage( $title, $foreignTitle, $revisionCount, + $successCount, $pageInfo ) { $args = func_get_args(); call_user_func_array( $this->mOriginalPageOutCallback, $args ); @@ -553,7 +557,7 @@ class ImportReporter extends ContextSource { $log->addEntry( 'upload', $title, $detail, array(), $this->getUser() ); } else { $interwiki = '[[:' . $this->mInterwiki . ':' . - $origTitle->getPrefixedText() . ']]'; + $foreignTitle->getFullText() . ']]'; $detail = $this->msg( 'import-logentry-interwiki-detail' )->numParams( $successCount )->params( $interwiki )->inContentLanguage()->text(); if ( $this->reason ) { @@ -579,7 +583,7 @@ class ImportReporter extends ContextSource { $page = WikiPage::factory( $title ); # Update page record $page->updateRevisionOn( $dbw, $nullRevision ); - wfRunHooks( + Hooks::run( 'NewRevisionFromEditComplete', array( $page, $nullRevision, $latest, $this->getUser() ) );